import 'package:flutter/material.dart';
import 'package:s_mankey/config/resource_mananger.dart';
import 'package:s_mankey/config/router_config.dart';
import 'package:s_mankey/generated/I18n.dart';
import 'package:s_mankey/ui/widget/show_toast.dart';

class HomeAppBar extends StatelessWidget implements PreferredSizeWidget {

  @override
  /// appBar的高度
  Size get preferredSize => Size.fromHeight(AppCustomSize.HomeAppBarHeight);

  @override
  Widget build(BuildContext context) {
    return AppBar(
      automaticallyImplyLeading: false,
      centerTitle: true,
      elevation: 0,
//      leading: GestureDetector(
//        onTap: () {
//          print("我要跳转签到啦");
//          Toast.toast(context,msg: "功能暂未开放 ");
//        },
//        child: Container(
//          padding: EdgeInsets.fromLTRB(AppPadding.Padding10, 0, 0, 4),
//          child: Icon(
//            IconData(0xe66b, fontFamily: IconFonts.fontFamily),
//            size: AppCustomSize.IconDataSize,
//          ),
//        ),
//      ),
      title:
      GestureDetector(
        onTap: () {
          Navigator.pushNamed(context, RouterName.homeSerch);

//          print('没错，我要跳到搜索页啦');
        },
        child: Container(
          height: 40,
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(20),
            color: AppColor.SerchBarColor,
          ),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.end,
            children: <Widget>[
             Padding(padding: EdgeInsets.fromLTRB(0, 0, 10, 5),child:  Icon(
               IconData(0xe66a, fontFamily: IconFonts.fontFamily),
               size: 25,
             ),),
            ],
          ),
        ),
      ),
//      actions: <Widget>[
//        Padding(
//          padding: EdgeInsets.fromLTRB(0, 0, AppPadding.Padding10 *2 , 0),
//          child: GestureDetector(
//            onTap: () {
//              print('我要跳转分类页啦。');
//              Toast.toast(context,msg: "功能暂未开放 ");
//            },
//            child: Column(
//              mainAxisAlignment: MainAxisAlignment.center,
//              children: <Widget>[
//                Text('ALL'),
//                Text(I18n.current.sort),
//              ],
//            ),
//          ),
//        )
//      ],
    );
  }

}
